package com.ambow.store.controller.util;

import lombok.Data;

import java.io.Serializable;

@Data
public class Result implements Serializable {
    private Integer state;
    private String message;
    private Object data;

    public Result() {
    }

    public Result(Integer state, Object data) {
        this.state = state;
        this.data = data;
    }

    public Result(Integer state, String message, Object data) {
        this.state = state;
        this.message = message;
        this.data = data;
    }

    public Result(Integer state, String message) {
        this.state = state;
        this.message = message;
    }

    public Result(Integer state) {
        this.state = state;
    }

    public Result(Throwable throwable) {
        this.message = throwable.getMessage();
    }
}
